import { axios } from '@/utils/request'

const api = {
  // 创建供货商
  creatSupplier: '/cloud/platform/regist',
  // 编辑供货商
  editSupplier: '/cloud/platform/edit',
  // 供货商列表
  supplierList: '/cloud/platform/list',
  // 删除供货商
  supplierDel: '/cloud/platform/del',
  // 修改供货商状态
  setSupplierStatus: '/cloud/platform/set-supplier-status',
  // 供货商提现列表
  supplierWithdrawList: '/cloud/platform/storeget-cash-list',
  // 供货商提现记录
  balanceCashList: '/cloud/platform/balance-cash-list',
  // 供货商商品列表
  supplierGoods: '/cloud/platform/goods-list',
  // 商户列表
  saasBusinessList: '/cloud/platform/store-mch-list',
  // 创建商户
  creatBusiness: '/cloud/platform/store-mch-add',
  // 删除商户
  businessDel: '/cloud/platform/store-mch-del',
  // 关联供应商
  setCloudPlatform: '/cloud/platform/set-cloud-platform',
  // 商户充值记录
  businessRecharge: '/cloud/platform/store-get-recharge-list',
  // 商户充值
  recharge: '/cloud/platform/store-submit-recharge',
  //编辑商户
  editBusiness: '/cloud/platform/store-mch-edit',
  // 余额记录
  balanceRecord: '/cloud/platform/store-get-balance-log',
  // 平台配置信息
  setting: '/saas/cloud-setting',
  // 提现处理
  withdrawStatus: '/cloud/platform/store-action-supplier-cash',
  // 平台审核列表
  goodsAuditList: '/cloud/platform/goods-audit-list',
  // 审核商品
  goodsAuditHandle: '/cloud/platform/goods-audit-handle',
  // 采购端申请自定义表单
  cloudCustomForm: '/saas/cloud-custom-form',
  // 获取采购商列表
  getPurchaseList: '/purchase/get-list',
  // 审核采购商
  applyPurchase: '/purchase/apply-purchase',
  // 删除采购商
  deletePurchase: '/purchase/delete-purchase',
  // 采购订单列表
  purchaseOrderList: '/cloud/supplier/supplier-order-list',
  // 订单发货
  orderSend: '/cloud/supplier/supplier-purchase-send',
  // 同意或拒绝取消申请
  checkApply: '/cloud/supplier/supplier-order-revoke',
  // 取消订单
  cancleOrder: '/cloud/supplier/supplier-order-revoke',
  // 订单修改地址
  setAddress: '/cloud/supplier/supplier-order-set-address',
  storeMchEnable: '/cloud/platform/store-mch-enable',
  supplierOrderDel: '/cloud/supplier/supplier-order-del',
  supplierOrderSend: '/cloud/supplier/supplier-order-send',
  supplierOrderXlsxSend: '/cloud/supplier/supplier-order-xlsx-send',
  setDistributionStatus: '/cloud/supplier/set-distribution-status',
  // 新订单列表
  supplierSendTypeList: '/cloud/supplier/supplier-send-type-list',
  // 新订单售后列表
  supplierSendTypeRefundList: '/cloud/supplier/supplier-send-type-refund-list',

  // 配货单配送单导出
  exportDistributionInfo: '/cloud/platform/export-distribution-info',

  // 配货单配送单导出
  getExportDistributionInfo: '/cloud/platform/get-export-distribution-info',
  setCanDistribution: 'cloud/platform/set-can-distribution',
  getDistributionList: 'cloud/merchant/get-distribution-list',
  getCloudGoodsUpdateLog: 'cloud/merchant/cloud-goods-update-log'
}

export default api

export function setCloudPlatform(parameter) {
  return axios({
    url: api.setCloudPlatform,
    method: 'post',
    data: parameter
  })
}

export function creatSupplier(parameter) {
  return axios({
    url: api.creatSupplier,
    method: 'post',
    data: parameter
  })
}

export function editSupplier(data) {
  return axios({
    url: api.editSupplier,
    method: 'post',
    data
  })
}

export function supplierList(parameter) {
  return axios({
    url: api.supplierList,
    method: 'post',
    data: parameter
  })
}

export function supplierDel(parameter) {
  return axios({
    url: api.supplierDel,
    method: 'post',
    data: parameter
  })
}

export function setSupplierStatus(parameter) {
  return axios({
    url: api.setSupplierStatus,
    method: 'post',
    data: parameter
  })
}

export function supplierWithdrawList(parameter) {
  return axios({
    url: api.supplierWithdrawList,
    method: 'post',
    data: parameter
  })
}

export function balanceCashList(parameter) {
  return axios({
    url: api.balanceCashList,
    method: 'post',
    data: parameter
  })
}

export function supplierGoods(parameter) {
  return axios({
    url: api.supplierGoods,
    method: 'post',
    data: parameter
  })
}

export function saasBusinessList(parameter) {
  return axios({
    url: api.saasBusinessList,
    method: 'post',
    data: parameter
  })
}

export function creatBusiness(parameter) {
  return axios({
    url: api.creatBusiness,
    method: 'post',
    data: parameter
  })
}

export function businessDel(parameter) {
  return axios({
    url: api.businessDel,
    method: 'post',
    data: parameter
  })
}

export function businessRecharge(parameter) {
  return axios({
    url: api.businessRecharge,
    method: 'post',
    data: parameter
  })
}

export function recharge(parameter) {
  return axios({
    url: api.recharge,
    method: 'post',
    data: parameter
  })
}

export function editBusiness(parameter) {
  return axios({
    url: api.editBusiness,
    method: 'post',
    data: parameter
  })
}

export function balanceRecord(parameter) {
  return axios({
    url: api.balanceRecord,
    method: 'post',
    data: parameter
  })
}

export function saveSetting(parameter) {
  return axios({
    url: api.setting,
    method: 'post',
    data: parameter
  })
}

export function getSetting(parameter) {
  return axios({
    url: api.setting,
    method: 'get',
    params: parameter
  })
}

export function withdrawStatus(parameter) {
  return axios({
    url: api.withdrawStatus,
    method: 'post',
    data: parameter
  })
}

export function goodsAuditList(data) {
  return axios({
    url: api.goodsAuditList,
    method: 'post',
    data
  })
}

export function goodsAuditHandle(data) {
  return axios({
    url: api.goodsAuditHandle,
    method: 'post',
    data
  })
}

export function getCloudCustomForm(parameter) {
  return axios({
    url: api.cloudCustomForm,
    method: 'get',
    params: parameter
  })
}

export function setCloudCustomForm(data) {
  return axios({
    url: api.cloudCustomForm,
    method: 'post',
    data
  })
}

export function getPurchaseList(parameter) {
  return axios({
    url: api.getPurchaseList,
    method: 'get',
    params: parameter
  })
}

export function applyPurchase(data) {
  return axios({
    url: api.applyPurchase,
    method: 'post',
    data
  })
}

export function deletePurchase(data) {
  return axios({
    url: api.deletePurchase,
    method: 'post',
    data
  })
}

export function purchaseOrderList(data) {
  return axios({
    url: api.purchaseOrderList,
    method: 'post',
    data
  })
}

export function supplierSendTypeList(data) {
  return axios({
    url: api.supplierSendTypeList,
    method: 'post',
    data
  })
}

export function supplierSendTypeRefundList(data) {
  return axios({
    url: api.supplierSendTypeRefundList,
    method: 'post',
    data
  })
}

export function orderSend(data) {
  return axios({
    url: api.orderSend,
    method: 'post',
    data
  })
}

export function checkApply(data) {
  return axios({
    url: api.checkApply,
    method: 'post',
    data
  })
}

export function cancleOrder(data) {
  return axios({
    url: api.cancleOrder,
    method: 'post',
    data
  })
}

export function setAddress(data) {
  return axios({
    url: api.setAddress,
    method: 'post',
    data
  })
}

export function storeMchEnable(data) {
  return axios({
    url: api.storeMchEnable,
    method: 'post',
    data
  })
}

export function supplierOrderDel(data) {
  return axios({
    url: api.supplierOrderDel,
    method: 'post',
    data
  })
}

export function supplierOrderSend(data) {
  return axios({
    url: api.supplierOrderSend,
    method: 'post',
    data
  })
}

export function supplierOrderXlsxSend(data) {
  return axios({
    url: api.supplierOrderXlsxSend,
    method: 'post',
    data
  })
}

export function setDistributionStatus(data) {
  return axios({
    url: api.setDistributionStatus,
    method: 'post',
    data
  })
}

export function exportDistributionInfo() {
  return process.env.VUE_APP_API_BASE_URL + api.exportDistributionInfo
}

export function getExportDistributionInfo(parameter) {
  return axios({
    url: api.getExportDistributionInfo,
    method: 'get',
    params: parameter
  })
}


export function setCanDistribution(data) {
  return axios({
    url: api.setCanDistribution,
    method: 'post',
    data
  })
}

export function getDistributionList(parameter) {
  return axios({
    url: api.getDistributionList,
    method: 'get',
    params: parameter
  })
}

export function getCloudGoodsUpdateLog(parameter) {
  return axios({
    url: api.getCloudGoodsUpdateLog,
    method: 'get',
    params: parameter
  })
}

